home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Canadian & World Encyclopedia 1998
/
The Canadian & World Encyclopedia 1998 - Disc 2.iso
/
mac
/
prime_CD
/
pb
/
PREVIEW.DIR
/
00152_Script_utilities
< prev
next >
Wrap
Text File
|
1997-07-22
|
5KB
|
172 lines
on b
global gArect
set gArect = gArect + rect(0,0,the mouseH, the mouseV)
put gArect
end
on t
global gArect
set gArect = rect(the mouseH, the mouseV,0,0)
end
on n
beginrecording
set the scriptnum of sprite 1 = the number of member "goFrameNormal"
updateframe
go the frame - 1
endrecording
end
on toLower str
set output = EMPTY
set offset = 32
repeat with i = 1 to length(str)
set ch = char i of str
set num = chartonum(ch)
case true of
(num >= 65 AND num <= 90): -- UPPERCASE TO LOWER
set ch = numtochar(num+offset)
(num >= 97 AND num <= 122): -- LOWERCASE TO UPPER
-- set ch = numtochar(num-offset)
otherwise:
nothing
end case
set output = output & ch
end repeat
return output
end
on writeTransScore
initglobals
set the updatelock = true
writeEraTransScore 1
writeEraTransScore -1
set the updatelock = false
go marker(-1)
end
on writeEraTransScore direction -- direction must be nz
-- for writing 16-bit transition code in eras scores
global gNextEraMovie
-- select correct era code
set gNextEraMovie = nextEraCode(new(script"eras navigator parent"), direction)
-- select & set new linked background filename
if the machinetype = 256 then
set theLinkedBGname = the moviepath & "..\" & gNextEraMovie & "\" & "ERA_" & gNextEraMovie & ".PCT"
else
set theLinkedBGname = the moviepath & ":" & gNextEraMovie & ":" & "ERA_" & gNextEraMovie & ".PCT"
end if
set the filename of member "nextBG" = theLinkedBGname
-- position to end of score
set lastLabel = lastLabel()
go label(lastLabel) + length(lastLabel)
set thisbg = getat(membscontaining("background.pct"), 1)
-- select transition
if direction > 0 then set transDir = "next"
if direction < 0 then set transDir = "prev"
set transMembName = transDir & "EraPush"
beginrecording
-- 'from' point
set the framelabel = transDir & "ERA"
set the frametempo = 8
set the framepalette = the number of member char 5 to 6 of the movie
set the frameScript = the number of member "set nextBG member"
set the memberNum of sprite 1 to the number of member thisbg
set the rect of sprite 1 = rect(0, 0, 640, 480)
set the stretch of sprite 1 to false
updateframe
-- 'to' point
set the framepalette = the number of member gNextEraMovie
set the frametransition = the number of member transMembName
set the framescript = the number of member "nextMovieJump"
set the memberNum of sprite 1 to the number of member "nextBG"
set the rect of sprite 1 = rect(0, 0, 640, 480)
set the stretch of sprite 1 to false
updateframe
endrecording
puppetpalette 0
end
on lastLabel
return line (the number of lines in the labellist-1) of the labellist
end
on posCredits -- positions credits sprites
global gCreditChan
if voidP(gCreditChan) then initGlobals
set creditSpriteTop = 460
set creditSpriteLeft = 300
go 1
set theLabelList = the labellist
repeat while the number of lines in theLabelList > 0
set theLabel = line 1 of theLabelList
delete line 1 of theLabelList
if theLabel <> "" then go theLabel
else exit
if the type of sprite gCreditChan = 16 then
beginrecording
set theCreditRect = rect(¼
creditSpriteLeft, ¼
creditSpriteTop, ¼
creditSpriteLeft + the width of the member of sprite gCreditChan, ¼
creditSpriteTop + the height of the member of sprite gCreditChan)
set the rect of sprite gCreditChan to theCreditRect
set the ink of sprite gCreditChan = 36 -- bkgd trans
updateframe
endrecording
end if
end repeat
end
on yearTOCtemplate -- updated 12/9/96
set source = getAt(membsContaining(".rtf"), 1)
set theText = the text of member source
put EMPTY into field "yearIndex"
set output = [:]
sort output
repeat while the number of lines in theText > 1
set theFirstWord = word 1 of line 1 of theText
set theSecondWord = word 2 of line 1 of theText
delete line 1 of theText
if integerP(integer(theFirstWord)) AND theSecondWord = "ò" then
put theFirstWord & return after field "yearIndex"
setAprop output, integer(theFirstWord), 0
end if
end repeat
return output
end
on waste howmuch
put the ticks into start
repeat while the ticks < start + howmuch
nothing
end repeat
beep -- debug
end
on assignPal newPaletteMembNum, castLibName -- assumes castnames of pct files are same as filenames in moviepath
if voidP(castLibName) then set castLibName = "internal"
put membsContaining(".pct") into membNameList
repeat with q in membNameList
set the palette of member q of castlib "internal" to newPaletteMembNum
-- set the filename of member q of castlib "internal" to q
end repeat
end
on updateCast newPaletteMembNum, castLibName -- assumes castnames of pct files are same as filenames in moviepath
if voidP(castLibName) then set castLibName = "internal"
put membsContaining(".pct") into membNameList
repeat with q in membNameList
set the palette of member q of castlib "internal" to newPaletteMembNum
set the filename of member q of castlib "internal" to q
end repeat
end